<?php
class Testmodel extends CI_Model {
	var $title = '';
	var $content = '';
	var $date = '';
	
	
	function __construct()
	{
	// Call the Model constructor
		parent::__construct();
	}
	function get_last_ten_users()
	{
		$query = $this->db->get('users', 10);
		return $query->result();
	}
	
	
	function insert_entry()
	{
		$this->title = $_POST['title']; // please read the below note
		$this->content = $_POST['content'];
		$this->date = time();
		$this->db->insert('entries', $this);
	}
	function update_entry()
	{
		$this->title = $_POST['title'];
		$this->content = $_POST['content'];
		$this->date = time();
		$this->db->update('entries', $this, array('id' => $_POST['id']));
	}
	function list_participants()
	{
		
		$query =$this->db->query("SELECT * FROM	users");
		return $query;
	}
}
?>